from time import sleep
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait

service = Service(executable_path="E:\python\python38\chromedriver.exe")
driver = webdriver.Chrome(service=service)
driver.get("http://121.43.169.97:8848/pageA.html")
action = ActionChains(driver)
#页码放大
driver.maximize_window()
sleep(5)
wait = WebDriverWait(driver, 10, 1)
# username = wait.until(lambda x: x.find_element_by_css_selector("#userA"))
# username.send_keys("admin")

username = wait.until(lambda x: x.find_element(By.CSS_SELECTOR, "#userA"))  # 假设 userA 是 id
username.send_keys("admin")


sleep(3)
driver.quit()